package com.luobo.home.controller;

import com.luobo.home.pojo.QuestionBank;
import com.luobo.home.service.BankMapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

// BankController.java
@RestController
@RequestMapping("/api/banks")
public class BankController {
    private final BankMapper bankMapper;

    public BankController(BankMapper bankMapper) {
        this.bankMapper = bankMapper;
    }

    @GetMapping
    public List<QuestionBank> getAllBanks() {
        System.out.println("Bank");
        return this.bankMapper.findAllBanks();
    }
}
